﻿using ET.Monitor.DAL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ET.Monitor.Model
{
    public class GroupModel
    {
        string gid;
        string gdesc_c;
        string gdesc_e;
        string ogid;
        GroupDAL gdl = new GroupDAL();

        public GroupModel()
        {
        }
        public GroupModel(string grpid)
        {
            gid = grpid;
        }
        public GroupModel(string grpid, string grpdesc_c, string grpdesc_e)
        {
            gid = grpid;
            gdesc_c = grpdesc_c;
            gdesc_e = grpdesc_e;
        }
        public GroupModel(string ogrpid, string grpid, string grpdesc_c, string grpdesc_e)
        {
            ogid = ogrpid;
            gid = grpid;
            gdesc_c = grpdesc_c;
            gdesc_e = grpdesc_e;
        }
        DataTable allGrpInfo;
        #region 获取所有的角色信息
        public DataTable AllGrpInfo
        {
            get { return gdl.GetAllGrpInfo(); }
            set { allGrpInfo = value; }
        }
        #endregion

        #region 增加新的角色
        object isAdd;
        public object AddGrp
        {
            get { return gdl.SaveRole(gid, gdesc_c, gdesc_e); }
            set { isAdd = value; }
        }
        #endregion

        #region 编辑原有的角色
        object isEdit;
        public object EditGrp
        {
            get { return gdl.UpDateRole(ogid, gid, gdesc_c, gdesc_e); }
            set { isEdit = value; }
        }
        #endregion

        #region 删除原有的角色
        object isDel;
        public object DelGrp
        {
            get { return gdl.DeleteRole(gid); }
            set { isDel = value; }
        }
        #endregion
    }
}
